package net.peelmeagrape.hibernate.collections;

import net.peelmeagrape.hibernate.xmlgen.XmlElement;
import net.peelmeagrape.hibernate.xmlgen.ChildElement;
import net.peelmeagrape.hibernate.xmlgen.XmlAttribute;
import net.peelmeagrape.hibernate.Generator;
import net.peelmeagrape.hibernate.Column;
import net.peelmeagrape.hibernate.Meta;

import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Define the id field for an {@link H8IdBag}.
 */
@Retention(RUNTIME)
@XmlElement(name="collection-id")
public @interface CollectionId
{
    @ChildElement(0) Meta[] meta() default {};
    @ChildElement(1) Column[] columnMapping() default {};
    @ChildElement(2) Generator generator();
    @XmlAttribute String type() default "";
    @XmlAttribute String column() default "";
    @XmlAttribute int length() default 255;
}
